<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  
 </head>
 <body>
  <script>
var tel = '我的电话是:1314567092'; 	//定义一个字符串
var reg = /[\d]{11}/;       			//含有11个数字的正则
document.write(tel.search(reg));	//若符合，则返回0；若不符合，则返回-1

  </script>
 </body>
</html>
